import { Injectable } from '@angular/core';
import {Observable} from "rxjs/Observable";
import {RequestUtil} from "../../util/request-util";
import {MsgAPI} from '../../admin/msg/msg-constants';
import {DamAPI} from '../../admin/peach/peach-constants';

declare var $,jQuery;


@Injectable()
export class AdminUtilService {

  constructor(
    private requestUtil: RequestUtil,
  ) { }

  /**
  * 获取报警信息
  */
  getWarnSiteInfo():Observable<any>{
    return this.requestUtil.get(MsgAPI.getWarnSiteInfo);
  }
  /**
   * 修改报警信息状态
   */
  putWarnSiteStatus(contentId):Observable<any>{
    return this.requestUtil.put(MsgAPI.putWarnSiteStatus+'/'+contentId+'?format=json');
  }
  /**
   * 获取国控站数据
   */
  getMapSiteData():Observable<any>{
    let params = "format=json&pointType=nationalSite";
    return this.requestUtil.get(DamAPI.mapSiteInfo,params);
  }
}
